//Tue Sep 20 13:17:39 CDT 2011
import java.util.*;
import java.util.regex.*;
import java.text.*;
import java.math.*;
import java.awt.geom.*;

public class ProblemsToSolve
{
	public int minNumber(int[] plet, int variety)
	{
		int N = plet.length;
		int ret = N;
		for(int i=0; i<N; i++){
			for(int j=i+1; j<N; j++){
				if(Math.abs(plet[i] - plet[j]) >= variety){
					ret = Math.min(ret, 1 + (i+1)/2 + (j-i+1)/2);
				}
			}
		}
		return ret;
	}
}
//Powered by [KawigiEdit] 2.0!
